home *** CD-ROM | disk | FTP | other *** search
- From: kim@amdahl.uts.amdahl.com (Kim DeVaughn)
- Subject: IPC ... an ARexx example
- Date: 7 Mar 88 12:32:57 GMT
- Organization: Amdahl Corporation, Sunnyvale, CA 94086
- Keywords: The wheel exists. It does not need reeinvention. It may need improvement.
-
-
- [ For all you do ... this line's for you ... ]
-
- With all the current discussion about IPC methodology, ARexx, and such, this
- seems like a good time to post the attached example of a simple form of an
- ARexx interface. It is being posted here, rather than in comp.sources.amiga,
- as it is short, and is primarily example code.
-
- In the attached shar file, you'll find a small standalone program called
- "rex" that I used to familiarize myself with the (COMMAND form of the)
- ARexx interface. You'll also find the actual interface file (rexx.c) that
- I used to interface Matt's "dme" editor to ARexx.
-
- Besides the rexx.c file, I only had to add about 20 lines of code to the
- dme sources (which Matt has improved upon, I believe). This interface
- added less than 2K to the dme executable. The changes to "dme" were to
- add the 3 "explicitly called" functions [rx(), rx1(), rx2()] to the command
- table, and to have dme call the do_rexx() function with the rest of the
- command-line as the argument, in the event of a "command not found"
- condition (for implicit invocation).
-
- Not included are the header files that come in the ARexx package ... I don't
- have Bill Hawes' permission to redistribute them (yet), nor the C bindings,
- but if you have ARexx, you have a copy of them anyway. Of course you need
- ARexx to run the "rex" example (try "rex args" to see what "rex" passes to
- ARexx, and watch what ARexx does when it tries to execute the "foo" command).
-
- Now this is a very simple and basic form of interface to ARexx. More
- sophisticated facilities are available. I just wanted to see what a minimal
- interface would look like, with a minimum of changes to dme.
-
- The dme interface works quite well, given that dme was never designed with
- such an interface in mind. There are some limitations because of the way
- dme does error and command completion reporting, but the point is that I
- was able to interface the two with very little effort. To fully take
- advantage of ARexx's capabilities will require some additional work in dme's
- innards, and perhaps the addition of some new dme commands.
-
- When Rob Peck posts his speechtoy with an ARexx interface, I think I'll see
- about making a "talking editor" out of dme using speechtoy (which could just
- as well be a spelling checker, etc.) Should be a piece of cake ...
-
-
- Now I'm not saying that the ARexx interface is perfect for all IPC applications,
- but it *is* quite powerful, and can be used pretty simply. Bill has done a
- very professional job of implementing the REXX interpreter, and providing an
- interface that is consistant with the Amiga OS. The supplied .libraries have
- many more additional functions than are used in the example files. These
- functions are not specific to ARexx per se, and can be used by any program
- that wants to take advantage of them (similar to the way one can take advantage
- of the ARP functions in the arp.library).
-
- Other advantages of ARexx are that it is small (rexxsyslib.library is less than
- 32K, and the resident program "rexxmast" is less than 2K), and fast, having
- been implemented in very tight assembly language. It is well documented, the
- manual being 140+ pages. It uses an established language for it's processing
- (REXX is one of the few really good things to make it out of Big Blue ... must
- be because it was a research project :-) ).
-
- And it is available NOW ... TODAY ... for less than fifty bucks!
-
-
- Sorry if I started sounding commercial, but it really *is* a good product.
- I hope the development community uses it as a base for a *standardized* IPC
- facility. If there are fundemental deficiencies in ARexx, Bill is a pretty
- reasonable guy, and I'm sure he'd be interested in improving the product.
-
- Enough verbage! Here's the code ...
-
- /kim
-
-
- --
- UUCP: kim@amdahl.amdahl.com
- or: {sun,decwrl,hplabs,pyramid,ihnp4,uunet,oliveb,cbosgd,ames}!amdahl!kim
- DDD: 408-746-8462
- USPS: Amdahl Corp. M/S 249, 1250 E. Arques Av, Sunnyvale, CA 94086
- CIS: 76535,25
-
-